package com.gsoe.judge.controller.admin;


import cn.dev33.satoken.annotation.SaCheckPermission;
import com.gsoe.base.model.Result;
import com.gsoe.dto.AIProblemDTO;
import com.gsoe.judge.service.ChatGLMService;
import com.gsoe.vo.ProblemVO;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/judge/admin/chatGLM")
public class ChatGLMController {

    @Autowired
    ChatGLMService chatGLMService;

    @PostMapping("/getAIProblem")
    @SaCheckPermission("problem_add_update")
    public Result<ProblemVO> getAIProblem(@RequestBody @Valid AIProblemDTO aiProblemDTO){
        return Result.success(chatGLMService.getAIProblem(aiProblemDTO));
    }
}
